﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AddIn.EA.Framework.Common;

namespace AddIn.EA.Framework
{
    /// <summary>
    /// Class that represent a list of conditions. Composite the Method class.
    /// </summary>
    public class MethodConditionList : BaseList<MethodCondition>
    {
        #region Constructors
        /// <summary>
        /// Get an instance of conditions list.
        /// </summary>
        /// <param name="reference">The reference of EA Object Model parameter collection.</param>
        /// <param name="parent">The parent element.</param>
        public MethodConditionList(EA_Application.Collection reference, IElement parent)
            : base(reference, parent) { }
        #endregion
    }

    /// <summary>
    /// Class that represent a condition.
    /// </summary>
    public class MethodCondition : BaseElement<EA_Application.MethodConstraint>
    {
        #region Constructors
        /// <summary>
        /// Get an instance of parameter.
        /// </summary>
        /// <param name="reference">The reference of EA Object Model parameter.</param>
        /// <param name="parent">The parent element.</param>
        public MethodCondition(EA_Application.MethodConstraint reference, IElement parent)
            : base(reference, parent) { }
        #endregion

        #region Properties

        #region BaseElement Members
        /// <summary>
        /// The condition id.
        /// </summary>
        public override int ID
        {
            get { return 0; }
        }
        /// <summary>
        /// The condition name.
        /// </summary>
        public override string Name
        {
            get
            {
                return this.Reference.Name;
            }
            set
            {
                this.Reference.Name = value;
            }
        }
        #endregion

        /// <summary>
        /// Notes for condition.
        /// </summary>
        public string Notes
        {
            get { return this.Reference.Notes; }
            set { this.Reference.Notes = value; }
        }

        /// <summary>
        /// The condition method id.
        /// </summary>
        public int MethodID
        {
            get { return this.Reference.MethodID; }
            set { this.Reference.MethodID = value; }
        }

        /// <summary>
        /// The condition type.
        /// </summary>
        public string Type
        {
            get { return this.Reference.Type; }
            set { this.Reference.Type = value; }
        }
        #endregion
    }
}
